---
layout: m1x_soap
title: Product Link Update
---

<h2><a name="catalog_product_link.update-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>


<h4><a name="catalog_product_link.update-Resource%3Acatalogproductlink"></a>Resource: catalog_product_link</h4>

<p><b>Aliases:</b></p>
<ul>
	<li>product_link</li>
</ul>


<h5><a name="catalog_product_link.update-Method%3A"></a>Method:</h5>

<ul>
	<li>catalog_product_link.update (SOAP V1)</li>
	<li>catalogProductLinkUpdate (SOAP V2)</li>
</ul>


<p>Allows you to update the product link.</p>

<p><b>Aliases:</b></p>
<ul>
	<li>product_link.update</li>
</ul>



<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> type <br class="atl-forced-newline" /> </td>
<td> Type of the link (cross_sell, grouped, related, or up_sell) </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> product\productId <br class="atl-forced-newline" /> </td>
<td> Product ID or SKU </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> linkedProduct\linkedProductId <br class="atl-forced-newline" /> </td>
<td> Product ID or SKU for the link </td>
</tr>
<tr>
<td> array </td>
<td> data <br class="atl-forced-newline" /> </td>
<td> Array of catalogProductLinkEntity </td>
</tr>
<tr>
<td> string </td>
<td> identifierType </td>
<td> Defines whether the product ID or SKU is passed in the 'product' parameter </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> boolean\int </td>
<td> result </td>
<td> True (1) if the link is updated </td>
</tr>
</tbody></table>


<p>The <b>catalogProductLinkEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> product_id <br class="atl-forced-newline" /> </td>
<td> Product ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> type <br class="atl-forced-newline" /> </td>
<td> Type of the link </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> set <br class="atl-forced-newline" /> </td>
<td> Product attribute set </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sku <br class="atl-forced-newline" /> </td>
<td> Product SKU </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> position <br class="atl-forced-newline" /> </td>
<td> Position </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> qty <br class="atl-forced-newline" /> </td>
<td> Quantity </td>
</tr>
</tbody></table>


<h4><a name="catalog_product_link.update-Examples"></a>Examples</h4>

<h5><a name="catalog_product_link.update-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$productId = '1';
$linkedProductId = '2';
$data = array(
	'position' =&gt; '50'
);

$result = $proxy-&gt;call(
	$session,
	'catalog_product_link.update',
	array(
		'cross_sell',
		$productId,
		$linkedProductId,
		$data
	)
);</pre>
		</div>
</div></div>


<h5><a name="catalog_product_link.update-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">&lt;?php

$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$session = $client-&gt;login('apiUser', 'apiKey');

$data = array(
   "position" =&gt; 15
  );

$identifierType = "product_id";
$type = "related";
$product = "1";
$linkedProduct = "3";

$orders = $client-&gt;catalogProductLinkUpdate($session, $type, $product, $linkedProduct, $data, $identifierType);

echo 'Number of results: ' . count($orders) . '&lt;br/&gt;';
var_dump ($orders);
?&gt;</pre>
		</div>
</div></div>


<h5><a name="catalog_product_link.update-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogProductLinkUpdate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'type' =&gt; 'cross_sell', 'productId' =&gt; '1', 'linkedProductId' =&gt; '2', 'data' =&gt; ((object)array(
'position' =&gt; '1'
))));

var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<?php include(__ROOT__ . 'footer.php'); ?>
